﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjetReseau
{
    [Serializable]
    class Primitive
    {
        public string type;
        public byte adresseSource;
        public byte adresseDestination;
        public string text;
        public byte adresseReponse;
        public char raison;

        public Primitive(byte _adresseSource, byte _adresseDestination, string _type)
        {
            this.adresseSource = _adresseSource;
            this.adresseDestination = _adresseDestination;
            this.type = _type;
        }

        public Primitive(byte _adresseDestination, string _text, string _type)
        {
            this.text = _text;
            this.type = _type;
            this.adresseDestination = _adresseDestination;
        }

        public Primitive(byte _adresseReponse, char _raison,  string _type)
        {
            this.adresseReponse = _adresseReponse;
            this.raison = _raison;
            this.type = _type;
        }

        public Primitive(byte _adresseReponse, string _type)
        {
            this.adresseReponse = _adresseReponse;
            this.type = _type;
        }

        public override string ToString()
        {
            return "Type : " + type + 
                ", Adresse source : " + adresseSource + 
                ", Adresse destination : " + adresseDestination +
                ", Données : " + text +
                ", Adresse réponse : " + adresseReponse +
                ", Raison : " + raison;
        }
    }
}
